const path=require('path')
module.exports = {
    chainWebpack: config => {
        config.resolve.alias
        .set("assets", path.resolve(__dirname,'./src/assets/'))
        .set("views", path.resolve(__dirname,'./src/views/'))
        .set("components", path.resolve(__dirname,'./src/components/'))
        .set("home", path.resolve(__dirname,'./src/components/home'))
    },
    //配置代理
    devServer:{
        proxy:{
            "/api":{
                target:"http://localhost:3005/",
                changeOrigin:true,
                pathRewrite:{
                    //重写路径
                    // '^/api':''
                }
            },
            "/redWineImg":{
                target:"http://kaola-pop.oss.kaolacdn.com/",
                changeOrigin:true,
                pathRewrite:{
                    //重写路径
                    // '^/api':''
                }
            },
            "/redWineFlag":{
                target:"http://kaola-haitao.oss.kaolacdn.com/",
                changeOrigin:true,
                pathRewrite:{
                    //重写路径
                    // '^/api':''
                }
            },
            "/img":{
                target:"http://localhost:8080",
                changeOrigin:true,
                '^/img':''
            }
        }
    }
    }
